package ro.ase.catalog.security.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import ro.ase.catalog.beans.Absence;
import ro.ase.catalog.beans.Student;
import ro.ase.catalog.beans.Teacher;
import ro.ase.catalog.beans.dto.AbsenceDTO;
import ro.ase.catalog.security.dao.IAbsenceDAO;
import ro.ase.catalog.security.service.IAbsenceService;

import java.util.Date;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Ioana
 * Date: 6/14/14
 * Time: 7:04 PM
 * To change this template use File | Settings | File Templates.
 */
public class AbsenceServiceImpl implements IAbsenceService {
    @Autowired
    IAbsenceDAO absenceDAO;
    public List<AbsenceDTO> displayAbsencesByStudent(Student student, Teacher teacher) {
        return absenceDAO.displayAbsencesByStudent(student, teacher);
    }

    public void saveAbsence(Absence absence) {
       absenceDAO.save(absence);
    }

    public void modifyAbsence(Absence absence) {
        absenceDAO.update(absence);
    }

    public Absence getAbsenceById(Integer id) {
        return absenceDAO.get(id);
    }

    public List<AbsenceDTO> displayAbsencesByStudent(Student student, Teacher teacher, Date date) {
        return absenceDAO.displayAbsencesByStudent(student, teacher, date);
    }

    public IAbsenceDAO getAbsenceDAO() {
        return absenceDAO;
    }

    public void setAbsenceDAO(IAbsenceDAO absenceDAO) {
        this.absenceDAO = absenceDAO;
    }
}
